db.define_table('images',
    db.Field('title'),
    db.Field('posted_on', 'datetime', default=request.now, writable=False),
    db.Field('posted_by', db.auth_user, writable=False),
    db.Field('file', 'upload'),
    )
db.images.title.requires = [
                            IS_NOT_EMPTY(),
                            IS_NOT_IN_DB(db, 'images.title'),
                            ]
db.images.file.requires = IS_NOT_EMPTY()
db.images.posted_by.requires = IS_NOT_EMPTY()


db.define_table('jiajia',
    db.Field('time'),
    db.Field('title'),
    )